{{indexmenu_n>29}}

%%{{indexmenu_n>32}}%% \\
Hidden code at top of page, Meta tag for Order Sorting  \\
Makes this page #32 when the TOC code has "msort" for meta-tag sort.

==== TOC & Indexmenu ====
Learning how the Indexmenu works and how to control appearance of Left navbar and page order.

==== Some simple page links ====

Index of 4 Books
  * [[OpenCPN:Developer_Manual|Developer Manual]]   
  * [[OpenCPN:Supplementary_Hardware|Supplementary Hardware]]
  * [[OpenCPN:Supplementary_Software|Supplementary Software]]  
  * [[OpenCPN:OpenCPN_User_Manual|OpenCPN User Manual]]

Level #2 Page Links (partial)
  * [[opencpn:opencpn_user_manual:getting_around:gps_setup_and_status]]
  * [[opencpn:opencpn_user_manual:Getting_Started]]
  * [[opencpn:opencpn_user_manual:Getting_Around]]
     * [[opencpn:opencpn_user_manual:getting_around:right_click_menu]]
     * [[opencpn:opencpn_user_manual:getting_around:keyboard_shortcuts]]
     * [[opencpn:opencpn_user_manual:getting_around:display_orientation]]
     * [[opencpn:opencpn_user_manual:getting_around:chart_status_bar]]
     * [[opencpn:opencpn_user_manual:getting_around:chart_info]]
  * [[opencpn:opencpn_user_manual:TOOLBAR Buttons]]
  * [[opencpn:opencpn_user_manual:MENUBAR]]
  * [[opencpn:opencpn_user_manual:CHARTS]]
  * [[opencpn:opencpn_user_manual:options_setting:Connections]]
  * [[opencpn:opencpn_user_manual:Plugins]]
  * [[opencpn:opencpn_user_manual:Advanced Features]]
  * [[opencpn:opencpn_user_manual:Terminology]]
  * [[opencpn:opencpn_user_manual:FAQ]]
  * [[opencpn:opencpn_user_manual:License and Authors]]
  * [[opencpn:edit_user_manual]]


==== Sidebar Page ====

The :opencpn:sidebar page has the indexmenu code for Left Navigation settings & controls.
The 'sidebar' page is hidden from users by using Admin > Config  "Hide sidebar" 

  * [[opencpn:sidebar]]
  * PATH %% [[opencpn:sidebar]] %%

We normally have a full Table of Contents here with all the html for the book following, in one long page.
Then the Left Sidebar has the 4 Books Navigation and OpenCPN User Manual expanded with all the next level pages showing.  http://opencpn.org/ocpn/opencpn_manual

[[:opencpn:sidebar|Sidebar 4 Book Navigation - left navigation Path':opencpn:sidebar' ]]

  - Use the default Template or other template that supports a "sidebar" page
  - Make a "sidebar" page just under the namespace (or book).
  - Insert the Indexmenu into the sidebar page.
  - Everything entered into the sidebar page is displayed in the left column.
  - Set the order of pages with msort[#meta]  see http://zigi.cc.fmph.uniba.sk/dokuwiki/wiki/indexmenu
  - In Sidebar put "indexmenu>:opencpn:opencpn_user_manual#5|navbar context msort nons"
  - Upper left corner put "indexmenu_n>12" (in double brackets) of each page, change number for position.

Sort pages by a custom metadata information. Without the optional meta parameter, it'll be used the custom sorting number specified with the {{indexmenu_n>N}} syntax (read below for more infos). meta should refer to the data structure (Array values are managed throught the “:“ separator, for example: „msort#date:modified). 

In the default dokuwiki template you set the sidebar page(s) in the config options: https://www.dokuwiki.org/config:sidebar.  You can hide the sidebar page itself in the indexmenu options, which gives you a choice of which pages to hide, using a regular expression.  In my case, I have the sidebar page set to :wiki:sidebar.  To hide it I use a simple regex: /sidebar/.

Indexmenu is fairly complex in its offering of options, so you can experiment and get what you find it an ideal

https://www.dokuwiki.org/config
Headpage method: the page from which retrieve the title and link of a namespace.
Can be any of this value:

    The global start page.
    A page with the namespace name and that is inside it.
    A page with the namespace name and that is at its same level.
    A custom name page.
    A comma separated list of page names.

==== Questions ====

  * Is there a way of showing the top title of a given page in the Sidebar rather than the file name?
     * Yes,  see [[opencpn:edit_user_manual:indexmenu_plugion|Indexmenu Plugin]]
  * Is there a way of sorting the namespaces and pages by a numbering system?
     * Yes, 'msort' and the indexmenu code at the top of the page.
     * See   see [[opencpn:edit_user_manual:indexmenu_plugion|Indexmenu Plugin]]
  * Why aren't the pages sorting properly and why do pages have a different Left navigation symbol? 
    * How can I fix this?  See [[opencpn:edit_user_manual:no_blue_dot|No Blue Dot]],    [[opencpn:edit_user_manual:sort_order|Sort Order]] and [[opencpn:edit_user_manual:fix_sorting|Fix Sorting]].


==== Sidebar Page :Setting Indexmenu parameters ====

=== Example: {{indexmenu>:#2\js}}  ===

:   - start at the root  :opencpn  \\
#2  - open the namespace down two levels  \\
js  - use javascript to expand & contract the tree  \\
navbar is not there so no left navigation bar \\

=== Example: {{indexmenu>:opencpn:opencpn_user_manual#2|js navbar msort}} =====

path - indexmenu>:opencpn:opencpn_user_manual \\
#2   - open the namespace down two levels \\
js   - use javascript to expand/contract \\
navbar  - show the navbar  (set to be on the left in Admin > Config)\\
msort   - sort by meta tag at head of each page  {{indexmenu_n>[OrderNumber]}} \\
nsort  - next sort pages without the numbered sort order.  \\

==== SiteExport Plugin: OpenCPN User Manual TOC ====

For this we want a non-expandable flat TOC with every page shown in proper order.

**%%{{indexmenu>:opencpn:opencpn_user_manual#7|msort nsort nojs skipns=/(opencpn:opencpn_user_manual:gallery_boats|opencpn:opencpn_user_manual:edit_user_manual|opencpn:opencpn_user_manual:toc)/}}%%** \\

Expand the outline down all levels '#5'  \\
Don't use 'navbar' because it is not needed. \\
Don't use  'js' because we are not expanding and contracting the tree. Use 'nojs" \\
Skip namespaces parameter "skipns=/(ns|ns\ns)/"
   * gallery_boats
   * edit_user_manual
   * toc

{{indexmenu>:opencpn:opencpn_user_manual#5|msort nsort nojs skipns=/(opencpn:opencpn_user_manual:gallery_boats|opencpn:opencpn_user_manual:edit_user_manual|opencpn:opencpn_user_manual:toc)/}}

